package com.synjones.wschool.face.serviceImpl;

import com.synjones.wschool.common.response.ResultBean;
import com.synjones.wschool.face.feign.FileOperationService;
import com.synjones.wschool.face.service.FileService;
import com.synjones.wschool.face.utils.ResponseHelper;
import lombok.extern.slf4j.Slf4j;
import org.omg.CORBA.portable.ResponseHandler;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * Created by 24398 on 2018/7/30.
 */

@Service
@Slf4j
public class FileServiceImpl implements FileService{

    @Resource
    private FileOperationService fileOperationService;

    @Override
    public byte[] downLoad(String imgUrl) {
        ResultBean<byte[]> resultBean = fileOperationService.downloadFile(imgUrl);
        byte[] bytes = ResponseHelper.parseResponseData(resultBean);
        return bytes;
    }
}
